package com.liuhaoqi.raletiveblog.service.Impl;

import com.liuhaoqi.raletiveblog.entity.Resource;
import com.liuhaoqi.raletiveblog.mapper.ResourceMapper;
import com.liuhaoqi.raletiveblog.result.business.PageResult.ResourcePageResult;
import com.liuhaoqi.raletiveblog.service.ResourceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author liuhaoqi
 * @Date 2020/4/21 10:54
 * @Version 1.0
 */
@Service
public class ResourceServiceImpl implements ResourceService {
    @Autowired
    ResourceMapper resourceMapper;

    @Override
    public int addResource(Resource resource) {
        return resourceMapper.addResource(resource);
    }

    @Override
    public int updateResourceByResourceId(Resource resource) {
        return resourceMapper.updateResourceByResourceId(resource);
    }

    @Override
    public int deleteResourceByResourceId(Long resourceId) {
        return resourceMapper.deleteResourceByResourceId(resourceId);
    }

    @Override
    public List<ResourcePageResult> getResourceListMang(int start, int end, int pagesize) {
        return resourceMapper.getResourceListMang(start,end,pagesize);
    }

    @Override
    public List<Resource> getResourceList() {
        return resourceMapper.getResourceList();
    }

    @Override
    public List<Resource> getResourceByTypeList(String resourceType) {
        return resourceMapper.getResourceByTypeList(resourceType);
    }
}
